const getSchedules = (start, end) => {
  return new Promise((resolve, reject) => {
    uni.request({
      url: 'https://vue.maylab.top/api/schedules/events', // 这里要和后端接口地址对应，若有统一前缀等需处理
      method: 'GET',
      data: {
        start,
        end
      },
      success: (res) => {
        if (res.statusCode === 200) {
          resolve(res.data);
        } else {
          reject(new Error('请求失败，状态码：' + res.statusCode));
        }
      },
      fail: (err) => {
        reject(err);
      }
    });
  });
};

export {
  getSchedules
};